import request from '@/libs/axios'

export const login = params => {
  return request({
    url: '/login',
    method: 'post',
    data: params
  })
}

export const getUserInfo = params => {
  return request({
    url: '/user-info',
    method: 'post',
    data: params
  })
}

export const logout = params => {
  return request({
    url: '/logout',
    method: 'post',
    data: params
  })
}

export const users = params => {
  return request({
    url: '/users',
    method: 'get',
    params: params
  })
}

export const usersList = params => {
  return request({
    url: '/users-list',
    method: 'post',
    data: params
  })
}

export const addUser = params => {
  return request({
    url: '/users',
    method: 'post',
    data: params
  })
}

export const editUser = params => {
  return request({
    url: '/users/' + params.id,
    method: 'put',
    params
  })
}

export const deleteUser = params => {
  return request({
    url: '/users/' + params.id,
    method: 'delete',
    params
  })
}

export const changeInfo = params => {
  return request({
    url: 'change',
    method: 'post',
    params
  })
}


